<template>
    <div class="login-container">
        <div style="width: 400px; margin: 150px auto">
            <div style="font-size: 30px; text-align: center; padding: 30px 0;"><span>登录</span></div>
            <el-form ref="form" :model="form" :rules="rules" size="large" label-width="100px">
                <el-form-item prop="username" label="姓名">
                    <el-input v-model.number="form.username"></el-input>
                </el-form-item>
                <el-form-item prop="password" label="密码" style="width: 100%;">
                    <el-input type="password" v-model="form.password" show-password></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button :disabled="!disabled" style="width: 60%; color: 143371;" type="primary" @click="login">登
                        录</el-button>
                </el-form-item>
            </el-form>
        </div>
    </div>
</template>
<script>
import request from "@/utils/request";
export default {
    data() {
        return {
            form: {
                username: "",
                password: ""
            },
            rules: {
                username: [
                    { required: true, message: "请输入姓名", trigger: "blur" }
                ],
                password: [{ required: true, message: "请输入密码", trigger: "blur" }],
            },
        }
    },
    computed: {
        disabled() {
            const { username } = this.form;
            const { password } = this.form
            return Boolean(username && password);
        },
    },
    mounted() {
       
    },
    methods: {
        login() {
            const _this = this;
            this.$refs.form.validate((valid) => {
                console.log(111)
                if (valid) {
                }
            });
        }
    }
}

</script>
<style scoped>
.login-container {
    position: fixed;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    background-image: url('@/assets/image/ncu_bgc.jpg');
    /* 其他背景属性 */
    background-repeat: no-repeat;
    /* 防止背景图片重复 */
    background-size: cover;
    /* 自适应元素大小 */
    background-position: center center;
    /* 图片居中对齐 */
}


.footer {
    left: 0;
    bottom: 0;
    color: #fff;
    width: 100%;
    position: absolute;
    text-align: center;
    line-height: 30px;
    padding-bottom: 10px;
    text-shadow: #000 0.1em 0.1em 0.1em;
    font-size: 14px;
}

.footer a,
.footer span {
    color: #fff;
}

span {
    color: #143371;
}
</style>